# encoding:utf-8
__author__ = 'shudong.msd'

from Queue import Queue

q = Queue()
# m = ''
# try:
#     m = q.get(True,1)
# except Exception as e:
#     print e
# q.put('a')
# q.put('b')
# q.put('c')
# q.put('d')
#
# print q.qsize()
#
# q.task_done()
# print q.qsize()





def f():
    time.sleep(3)
    # task_done 每次完成任务会递减任务数量，直到队列为空，从而唤醒queue.join(),使用get()无法唤醒
    q.task_done()
    q.task_done()
    q.task_done()
    q.task_done()

from threading import Thread
import time
t = Thread(target=f)
t.setDaemon(True)
t.start()


print q.get()
print "///"
#q.join()

#print q.get()